#include "../include/term.hpp"
#include "../include/variable.hpp"
#include "../include/q.hpp"
#include <iostream>
#include <string>
#include <vector>

using namespace mt;
using namespace std;

int main(int argc, char** argv) {
  typedef Q<int> t_int;
  Variable<t_int> x0;
  Variable<t_int> x1("x",1);
  Variable<t_int> x2("x",2);
  Variable<t_int> x3("x",3);
  Variable<t_int> x4(x2);
  Term<t_int> z1(1,x2);
  Term<t_int> z2(3,x4);
  Term<t_int> z3(2);
  Term<t_int> z4(3);
  Term<t_int> z5;
  z5 = z1 + z2;
  z1.addVariable(x1);
  z2.addVariable(x3);
  cout << (areLikeTerms(z1,z2)) << endl;
  cout << (areLikeTerms(z3,z4)) << endl;
  cout << (z5.getCoefficient());
  std::vector<Variable<t_int> > a = z5.getVariable();
  Variable<t_int> temp;
  for (int i=0; i < a.size(); i++) {
    temp = a[i];
    cout << temp.getName() << "^" << temp.getExponent();
  }
  cout << endl;

  cout << (z4.getCoefficient());
  std::vector<Variable<t_int> > b = z4.getVariable();
  Variable<t_int> temp1;
  for (int i=0; i < b.size(); i++) {
    temp1 = b[i];
    cout << temp1.getName() << "^" << temp1.getExponent();
  }
  cout << endl;
  return 0;

}
